﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Learn_MVC.Controllers
{
    public class HelloWorldController : Controller
    {
        // GET: HelloWorld
        public ActionResult Index()
        {
            return View();
        }
        //public string Index()
        //{
        //    return " THis is my <b> default <b/> action !";
        //}

        //public string Welcome( string name, int numtimes=1)
        //{
        //    //return "This is the Welcome action!";
        //    return HttpUtility.HtmlEncode("Hello "+name+",NumTimes is:"+numtimes);
        //}
        public ActionResult Welcome(string name,int numtimes=1)
        {
            ViewBag.Mg = "Hello " + name;
            ViewBag.Nt = numtimes;
            return View();

        }
        public string Welcome2(string name, int ID = 1)
        {
            //return "This is the Welcome action!";
            return HttpUtility.HtmlEncode("Hello " + name + ",ID is:" + ID);
        }
    }
}